
<template>
  <section class="bgff p20" style="min-height:100%;">
    <section>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item label="所属区域">
            <el-select v-model="formInline.region" filterable placeholder="所属区域">
              <el-option label="雨城区" value="shanghai"></el-option>
              <el-option label="名山区" value="beijing"></el-option>
              <el-option label="天全县" value="beijing"></el-option>
              <el-option label="荥经县" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="项目名称">
            <el-select v-model="formInline.projectName" filterable placeholder="项目名称">
              <el-option label="项目1" value="1"></el-option>
              <el-option label="项目2" value="2"></el-option>
              <el-option label="项目3" value="3"></el-option>
            </el-select>
          </el-form-item>
            <el-form-item label="姓名">
                <el-input v-model="formInline.user" filterable placeholder="姓名"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSubmit">查询</el-button>
                <el-button type="primary" @click="dialogFormVisible=true">新增</el-button>
            </el-form-item>
        </el-form>
    </section>
    <section>
      <el-table :data="tableData" border style="width: 100%">
        <!--<el-table-column prop="date" label="创建日期" width="180"></el-table-column>-->
        <el-table-column prop="name" label="姓名" width="180"></el-table-column>
        <el-table-column prop="phone" label="联系电话"></el-table-column>
        <el-table-column prop="project" label="所属项目"></el-table-column>
        <el-table-column prop="position" label="职位"></el-table-column>
        <el-table-column prop="last" label="上次登录时间"></el-table-column>
      </el-table>
    </section>
    <el-dialog title="新增用户" :visible.sync="dialogFormVisible">
      <el-form :model="form">
        <el-form-item label="用户名" :label-width="formLabelWidth">
          <el-input v-model="form.name" auto-complete="off" placeholder="请输入用户名"></el-input>
        </el-form-item>
        <el-form-item label="状态" :label-width="formLabelWidth">
          <el-radio v-model="form.radio" label="1">激活</el-radio>
          <el-radio v-model="form.radio" label="2">禁用</el-radio>
        </el-form-item>
        <el-form-item label="项目" :label-width="formLabelWidth">
          <el-select v-model="form.region" placeholder="请选择项目">
            <el-option label="项目A" value="program1"></el-option>
            <el-option label="项目B" value="program2"></el-option>
            <el-option label="项目C" value="program3"></el-option>
            <el-option label="项目D" value="program4"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="部门" :label-width="formLabelWidth">
          <el-select v-model="form.region" placeholder="请选择部门">
            <el-option label="技术部" value="it"></el-option>
            <el-option label="研发部" value="depart"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="角色" :label-width="formLabelWidth">
          <el-select v-model="form.region" placeholder="请选择角色">
            <el-option label="管理员" value="it"></el-option>
            <el-option label="编辑" value="depart"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </section>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        user: "",
        region: ""
      },
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          phone: "13880000010",
          project:'项目A',
          position:'调度员',
          last:'2016-05-14'
        }, {
          date: "2016-05-02",
          name: "张三",
          phone: "13880000020",
          project:'项目B',
          position:'值班员',
          last:'2016-05-13'
        }, {
          date: "2016-05-02",
          name: "李四",
          phone: "13880000031",
          project:'项目C',
          position:'调度员',
          last:'2016-05-11'
        }, {
          date: "2016-05-02",
          name: "王无",
          phone: "13880000002",
          project:'项目A',
          position:'调度员',
          last:'2016-05-14'
        }, {
          date: "2016-05-02",
          name: "赵六",
          phone: "13880000005",
          project:'项目A',
          position:'管理员',
          last:'2016-05-12'
        }, {
          date: "2016-05-02",
          name: "马七",
          phone: "13880000007",
          project:'项目A',
          position:'调度员',
          last:'2016-05-13'
        }, {
          date: "2016-05-02",
          name: "王大虎",
          phone: "13880000005",
          project:'项目A',
          position:'调度员',
          last:'2016-05-14'
        }
      ],
      value1: "",
      dialogFormVisible:false,
      form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: '',
          radio:''
        },
        formLabelWidth: '120px'
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
    }
  }
};
</script>

<style lang="less">
</style>
